home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.004 / xemacs-1 / xemacs-19.13 / src / sunpro.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-08-07  |  2.8 KB  |  113 lines

  1. /* Sunpro-specific routines.
  2.  
  3.    Copyright (C) 1994 Sun Microsystems, Inc.
  4.  
  5. This file is part of XEmacs.
  6.  
  7. XEmacs is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2, or (at your option) any
  10. later version.
  11.  
  12. XEmacs is distributed in the hope that it will be useful, but WITHOUT
  13. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15. for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with XEmacs; see the file COPYING.  If not, write to the Free
  19. Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  20.  
  21. /* Synched up with: Not in FSF. */
  22.  
  23. #include <config.h>
  24. #include "lisp.h"
  25.  
  26. /* ####
  27.  
  28.   The following junk used to be in lisp/prim/files.el.  It obviously
  29.   doesn't belong there, but should go somewhere.
  30.  
  31.   (if (fboundp 'ut-log-text)    ;; #### Sun stuff; what is this?
  32.       (ut-log-text "Reading a file."))
  33. */
  34.  
  35. /* Whether usage tracking is turned on (Sun only) */
  36. Lisp_Object Vusage_tracking;
  37. #ifdef USAGE_TRACKING
  38. #include <ut.h>
  39. #endif
  40.  
  41. DEFUN  ("ut-log-text", 
  42.     Fut_log_text, 
  43.     Sut_log_text, 
  44.     1, MANY, 0,
  45.     "Log a usage-tracking message if `usage-tracking' is non-nil.\n\
  46. Args are the same as to `format'.  Returns whether the message was\n\
  47. actually logged.  If usage-tracking support was not compiled in, this\n\
  48. function has no effect and always returns `nil'.  See function\n\
  49. `has-usage-tracking-p'.")
  50.      (nargs, args)
  51.      int nargs;
  52.      Lisp_Object *args;
  53. {
  54. #ifdef USAGE_TRACKING
  55.   Lisp_Object xs;
  56.   unsigned char *s; /* #### Does not support I18N4. */
  57.  
  58.   if (!NILP (Vusage_tracking))
  59.     {
  60.       xs = Fformat (nargs, args);
  61.       CHECK_STRING (xs, 0);
  62.       s = string_data (XSTRING (xs));
  63.       ut_log_text ((char *) s);
  64.     }
  65.   return Vusage_tracking;
  66. #else
  67.   return Qnil;
  68. #endif
  69. }
  70.  
  71.  
  72. /************************************************************************/
  73. /*                            initialization                            */
  74. /************************************************************************/
  75.  
  76. void
  77. syms_of_sunpro (void)
  78. {
  79.   defsubr (&Sut_log_text);
  80. }
  81.  
  82. void
  83. vars_of_sunpro (void)
  84. {
  85.   DEFVAR_LISP ("usage-tracking", &Vusage_tracking,
  86.     "Whether usage tracking is turned on (Sun only).\n\
  87. Has no effect if usage tracking support has not been compiled in.");
  88.   Vusage_tracking = Qnil;
  89.  
  90.   Fprovide (intern ("sparcworks"));
  91. #ifdef USAGE_TRACKING
  92.   Fprovide (intern ("usage-tracking"));
  93. #endif
  94. }
  95.  
  96. void
  97. init_sunpro (void)
  98. {
  99. #ifdef USAGE_TRACKING
  100.   if (!purify_flag)
  101.     {           /* Enabled only when not dumping an executable */
  102.       Vusage_tracking = Qt;
  103.       ut_initialize ("xemacs", NULL, NULL);
  104.     }
  105.   else
  106.     {
  107.       Vusage_tracking = Qnil;
  108.     }
  109. #else
  110.   Vusage_tracking = Qnil;
  111. #endif
  112. }
  113.